-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for styling lines and shapes in Select One from Map questions #6083
Conversation
17f5071
to
b2ec0a4
Compare
b2ec0a4
to
8a66b4a
Compare
8a66b4a
to
15cc891
Compare
androidshared/src/main/java/org/odk/collect/androidshared/utils/ColorUtils.kt
Outdated
Show resolved
Hide resolved
...ct_app/src/main/java/org/odk/collect/android/widgets/items/SelectOneFromMapDialogFragment.kt
Outdated
Show resolved
Hide resolved
mapbox/src/main/java/org/odk/collect/mapbox/DynamicPolyLineFeature.kt
Outdated
Show resolved
Hide resolved
mapbox/src/main/java/org/odk/collect/mapbox/StaticPolyLineFeature.kt
Outdated
Show resolved
Hide resolved
geo/src/main/java/org/odk/collect/geo/selection/SelectionSummarySheet.kt
Outdated
Show resolved
Hide resolved
611d23b
to
82da1e1
Compare
82da1e1
to
d67cb4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just one small tweak. I'll mark this ready for testing now.
mapbox/src/main/java/org/odk/collect/mapbox/DynamicPolyLineFeature.kt
Outdated
Show resolved
Hide resolved
It's impossible to add points in Geotrace widget (all input methods, all map sources) Steps to reproduce:
The issue doesn’t occur on the master version 213624d and the store version |
86f8af6
to
a5414b5
Compare
a5414b5
to
aea9dd2
Compare
The issue is fixed. |
In Google maps the color of the background in shapes and the outline seems to fade while zooming in when the shape covers a building on a map. The outline that is beyond a building doesn't fade. Other sources of maps don't work in that way. googleBuilding.mp4 |
Should the outline/stroke in a shapes in Mapbox work like the other sources of maps after the fix? |
I'm also not sure what should be the expected result if a stroke width is set and I zoom in and out - should it scale? e.g. if the outline is as wide as a street and I zoom out should it keep the width of a street after zooming out? scale.mp4 |
This issue is not caused by this particular pull request, but rather appears to be default behavior in Google Maps. Consequently, I don't think we should alter it. The key distinction here lies not in the fading of colors, but in the fact that Google Maps displays 3D buildings, whereas Mapbox and OSM do not. Should we consider changing it? My stance remains unchanged I don't believe it's necessary. While it's important to ensure compatibility across different map providers, we needn't strive for absolute uniformity at any cost. |
It should scale. Otherwise, it would disappear after zooming out if for example as you said it was the size of a street. |
I have forgotten to mention (the description is now updated):
|
Given @getodk/testers have already started testing on the PR branch, I'll hold off merging this for now. |
@seadowg If you have time you can merge it cause it's easier for us to test everything at the same time (as at the moment there are a few PR waiting to be tested and we're a bit short of time). |
Tested with Success! Verified on devices with Android 10, 14 Verified Cases:
|
Tested with Success! Verified on device with Android 11 |
Closes #5945
Why is this the best possible solution? Were any other approaches considered?
This is a continuation of #5278 and the approach is also the same so there is nothing important to discuss here.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
As described in the issue we are introducing new ways of styling map elements (lines and polygons). Everything that's map-related needs to be tested with all three providers google, mapbox, and osm.
The only problem is that there is no way to set the width of a line in polygons in Mapbox. It's just not supported at this moment. We could have tried to deal with it somehow by drowning additional lines on top of the borders of a polygon but I don't think it's necessary. Let's wait for Mapbox to add this option.
Do we need any specific form for testing your changes? If so, please attach one.
I've used:
s1FromMap.xlsx
items.geojson.txt
Does this change require updates to documentation? If so, please file an issue here and include the link below.
Yes getodk/docs#1780
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still pass